Metadata-based general request translator for distributed computer systems

ABSTRACT

In an embodiment, a method comprises generating and storing metadata that maps a domain model to data stored in a data store, wherein the domain model describes the data and relationships between the data; receiving, from a client application, a request for data stored in the data store, wherein the request is in a first query language; translating the request into one or more queries based on the metadata, wherein the one or more queries are in a second query language; sending the one or more queries to the data store; receiving a first result set from the data store, based on the data store executing the one or more queries.

BENEFIT CLAIM

This application claims the benefit under 35 U.S.C. § 119(e) ofprovisional application 62/538,576, filed Jul. 28, 2017, the entirecontents of which is hereby incorporated by reference as if fully setforth herein.

FIELD OF THE DISCLOSURE

The present disclosure relates generally to query processing innetworked, distributed computer systems. More specifically, thedisclosure relates to computer-implemented techniques for data retrievalusing a metadata-based general request translator and an adaptivestorage optimizer.

BACKGROUND

The approaches described in this section are approaches that could bepursued, but not necessarily approaches that have been previouslyconceived or pursued. Therefore, unless otherwise indicated, it shouldnot be assumed that any of the approaches described in this sectionqualify as prior art merely by virtue of their inclusion in thissection.

Cloud-based computer program applications may be built on backendservices that expose an application interface (API) which serves data toa frontend, such as a user interface or other services. The backendservices may connect to a data store, such as a relational database,that can be queried using a query language such as structured querylanguage (SQL). The backend services interpret client requests, sendscorresponding requests to a data store, and transforms the received datainto a transport format according to the service's convention (e.g., XMLor JSON).

Different end points may be implemented for specific information needs.However, writing and maintaining the code for each of these end pointsis a major cost driver in the development of a cloud-based application.In addition, as the information needs of the consumers change over time,changes in the conventions of the corresponding end points are required.If backward compatibility is desired, multiple versions of each endpoint's code must be maintained, which multiplies the maintenance cost.

Some existing frameworks, e.g. Spring, Struts, Hibernate, Ruby on Rails,simplify the generation of suitable requests to the datastore. Forcertain constrained use cases, such as Create, Read, Update or Delete(CRUD) services, the automatic generation of end point code is possible.However, generic storage and generated CRUD services provide poorperformance compared to manually configured storage and coded endpoints. Typically, a person designing the backend services usesknowledge about the anticipated usage patterns and data volume tooptimize the backend, while the generated CRUD services are unable to beoptimized based on anticipated usage patterns and data volume.Furthermore, CRUD services are unable to efficiently handle complexqueries spanning multiple entities.

One possible solution is to expose fewer end points, each with morepowerful query capabilities. To maximize flexibility, the data store'squery language could be directly exposed to the frontend services.However, this approach is not viable because 1) security considerationsprohibit sending queries directly from the client to the data store; 2)queries may get too long and complicated; and 3) any changes in the datastore would cause the consuming applications to cease to function.

Another possible approach is to use single end points with a high-leveluniversal query language that is decoupled from the internal data storerepresentation. They may expose metadata describing the types ofobjects, attributes and relations between objects, which allows the APIconvention to be stable even when information in the data store needs tochange. Only the metadata returned by the API changes, and the consumerscan often dynamically adapt to this. This approach may be implemented ongeneric data stores using, for example, Metaweb's Freebase and MQLlanguage and SAP's HANA Graph which exposes the GEM language. Sincethese stores have no predefined schema for specific object types, thetranslation between high-level queries and the data store can begeneric. However, generic data stores have disadvantages such as highercost and/or lower performance compared to conventional databases.

Another high-level query language is Graph QL. However, Graph QL needsto be mapped to a pre-defined schema by means of code. Thus, while itshares the advantage of having a stable API, it still requires writingor re-writing code to establish or change a backend service. Also, GraphQL cannot express aggregations such as sums, averages, and counts, whichmeans that any aggregations that may be required must be pre-defined andimplemented in backend code.

Thus, a solution that does not require choosing between well-performingbackends at the cost of developing, testing and deploying code andhaving limited flexibility with respect to the possible queries, orflexible, data-driven generic backends that can't handle complexanalytical queries while maintaining good performance is desired.

SUMMARY

The appended claims may serve as a summary of the invention.

Broadly stated, the present method recites a method according to claim1.

The present system also recites a computing system according to claim11, a computing device according to claim 12 and a computer programclaim according to claim 13.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings:

FIG. 1 is a block diagram illustrating an example system in which thetechniques described herein may be practiced, according to oneembodiment.

FIG. 2 is a block diagram illustrating an example metadata creationprocess, according to one embodiment.

FIG. 3 is a block diagram illustrating an example request handlingprocess, according to one embodiment.

FIG. 4 illustrates an example request for data in a general requestlanguage.

FIG. 5 is a block diagram illustrating an example request translationprocess, according to one embodiment.

FIG. 6 is a block diagram illustrating an example abstract syntax tree.

FIG. 7 is a block diagram illustrating an example structural model.

FIG. 8 is a block diagram illustrating example annotations of astructural model.

FIG. 9 is a block diagram illustrating an example translated query.

FIG. 10 is a block diagram that illustrates a computer system upon whichan embodiment of the invention may be implemented.

DETAILED DESCRIPTION

In the following description, for the purposes of explanation, numerousspecific details are set forth in order to provide a thoroughunderstanding of the present invention. It will be apparent, however,that the present invention may be practiced without these specificdetails. In other instances, well-known structures and devices are shownin block diagram form in order to avoid unnecessarily obscuring thepresent invention.

1.0 General Overview

Techniques are described herein for data retrieval using ametadata-based general request translator.

A general request language is tailored to the needs of analyticalapplications (supporting specifically multi-level aggregation ontables). In an embodiment, the request language combines traits of SQL,such as field selection, filtering, and aggregation, with traits ofgraph-based query languages, such as traversal of relations. Frontendclient applications send requests using the general request language.The request language may allow requests with theoretically unlimitedlevels of nesting, which makes it sufficiently expressive to cover allthe information needs of most client applications. A metadata-drivengeneral request translator translates requests from the general requestlanguage into storage-specific queries.

The metadata comprises a domain model, which describes names and datatypes of objects, attributes, and associations of data stored in thedata storage, in a storage-agnostic manner. Additionally, the metadatamay comprise a mapping of these objects, attributes and associations toportions of the data stored in the data storage. For example, themapping may map objects, attributes, and associations of the domainmodel to tables, fields and JOIN expressions of a relational database.

In an embodiment, a metadata service exposes the ability for users toread and write the domain model. By writing to the domain model, entity,attribute and association types are created, changed or deleted. Whennew entity or property types are created, corresponding tables andcolumns may be automatically generated to store entities and propertiesof these types.

In an embodiment, a data service endpoint receives a request specifiedin the general request language and passes it to the request translator.The request translator translates the request into a corresponding querylanguage statement, such as a SQL statement, to answer the request.After executing that query statement, the results are transformed intothe appropriate response format by a generic transformer.

In an embodiment, the request language allows the definition ofsoft-coded views for frequently used queries. The request translator maysimply substitute the view definitions for the view shorthand names.Additionally or alternatively, the frequency and total time consumed forrequests using each of these views may be recorded. When a certainthreshold of frequency and/or total time consumed for requests is passedduring a specified time interval, a storage optimizer may modify thedata store to better serve recorded usage patterns.

In an embodiment, the storage optimizer may create indexes andmaterialized database views for the whole or parts of the soft-codedview. Thus, the system provides a self-optimizing backend that generatesdata structures that are best for a client or customer's usage pattern,without involving a system administrator or other user.

In addition, since it is also reliably isolated against the databaseitself by the translation process, complex queries that are implementedin the backend code in conventional applications can now be definedexclusively in the frontend code.

A benefit of the techniques describe herein is that they solve thetradeoff situation described above by providing a generic backend foranalytical applications that optimizes itself dynamically by observingthe usage patterns. The generic backend is provided as a service thatcan be set up and maintained for an individual application withoutdevelopment and deployment of any code, but at the same time providesperformance comparable to manually created backends usingself-optimization. The development lifecycle for new applications leavesout the expensive part of backend code development, test and deployment,as it only consists of configuring the domain model and writing frontendcode.

An additional advantage is that the extensibility and the metadataservice can be used to create data-driven user interfaces that arerobust against backend changes, thus eliminating a frequent source ofdefects—i.e., the mismatch between backend and frontend code.Furthermore, keeping multiple versions of the backend behavior meanssimply keeping multiple versions of the metadata, which comes at minimalcost compared to keeping multiple versions of backend code.

2.0 System Overview

FIG. 1 illustrates an example system in which the techniques describedherein may be implemented.

In an embodiment, a computer system 100 comprises components that areimplemented at least partially by hardware at one or more computingdevices, such as one or more hardware processors executing storedprogram instructions stored in one or more memories for performing thefunctions that are described herein. In other words, all functionsdescribed herein are intended to indicate operations that are performedusing programming in a special-purpose computer or general-purposecomputer, in various embodiments. FIG. 1 illustrates only one of manypossible arrangements of components configured to execute theprogramming described herein. Other arrangements may include fewer ordifferent components, and the division of work between the componentsmay vary depending on the arrangement.

Embodiments of the system 100 may include, but are not limited to, astandalone computer system that includes data storage and displaycomponents, a multiple computer server system with multiple componentsconfigured and implemented and multiple computer systems, or a multiplecomputer server system with multiple components configured andimplemented on server systems located within a cloud server.

Computer system 100 receives arbitrary data retrieval and analyticalrequests on data at the lowest available granularity and provides anabstraction from the underlying data store engine and the technicalartifacts used for data representation.

In FIG. 1, computer system 100 comprises a metadata service 110, ametadata store 112, a data service 120, and one or more data stores 130.

2.1 Client Computer

In an embodiment, computer system 100 is configured to receive requestsfrom a client computer 102. The client computer 102 may becommunicatively connected to computer system 100 through any kind ofcomputer network using any combination of wired and wirelesscommunication, including, but not limited to: a Local Area Network(LAN), a Wide Area Network (WAN), one or more internetworks such as thepublic Internet, or a company network.

In an embodiment, client computer 102 is any computing device, such as aserver, rack, work station, personal computer, general purpose computer,laptop, Internet appliance, wireless device, wired device,multi-processor system, mini-computer, hand-held computer, wearablecomputer, cellular or mobile phone, portable digital assistant (PDAs, ortablet computer), and the like. Although a single client computer 102 isdepicted in FIG. 1, computer system 100 may receive requests from anynumber of client computers.

Client computer 102 includes other hardware elements, such as one ormore input devices, memory, processors, and the like, which are notdepicted in FIG. 1. Client computer 102 also includes applications,software, and other executable instructions to facilitate variousaspects of embodiments described herein. These applications, software,and other executable instructions may be installed by a user, owner,manufacturer, or other entity related to the client computer or thecomputer system.

Client computer 102 may execute a command line interface, a graphic userinterface, a REST endpoint, or other front-end application or service tointeract with the system 100. The graphic user interface may bedisplayed in a browser executing on client computer 102.

In an embodiment, the interface, endpoint, application and/or servicemay be configured or programmed to provide a search query to thecomputer system 100 and receive a set of search results generated bycomputer system 100. In an embodiment, the set of search results may bestored in a data file provided to the client computer or in a data fileaccessible by the client computer. Example data files include JSON,comma separated values, SQL dump, and other file types. Additionally oralternatively, the set of search results may be displayed at clientcomputer using, for example, the command line interface or the graphicaluser interface.

In an embodiment, the interface, endpoint, application and/or servicemay be configured or programmed to request domain model information fromcomputer system 100 and receive metadata describing the domain model.The metadata may be used to formulate the search queries provided to thesystem 100.

Additionally or alternatively, the interface, endpoint, applicationand/or service may be configured or programmed to provide domain modelconfiguration requests to computer system 100. The domain modelconfiguration requests may be, for example, requests to add, remove, ormodify domain model entities and/or properties.

2.2 Metadata Service

In an embodiment, a domain model describes the data stored in data storeand relationships and/or associations between the data. The models arein a form that is agnostic of the actual storage technology (e.g.RDBMS). The domain model may comprise a plurality of entities. Thelogical model may include sub-typing an inheritance. A particular entitymay comprise a set of one or more sub-types of the particular entity.For example, an “article” may have sub-types “sports,” “home goods,”“clothing,” and “electronics,” which inherit all fields from the“article” entity and have additional fields according to their specificnature. The entities are connected by named associations, which usuallyhave the same name as the associated entity. Thus, the data and thedomain model effectively form a large and complex graph.

In one embodiment, metadata store 112 is a data storage subsystemconsisting of programs and data that is stored on any suitable storagedevice such as one or more hard disk drives, memories, or any otherelectronic digital data recording device configured to store data.Although metadata store 112 is depicted as a single device in FIG. 1,metadata store 112 may span multiple devices located in one or morephysical locations. For example, metadata store 112 may include one ornodes located at one or more data warehouses. Additionally, in oneembodiment, metadata store 112 may be located on the same device ordevices as metadata service 110, data service 120, and/or data store130. Alternatively, metadata store 112 may be located on a separatedevice or devices from metadata service 110, data service 120, and datastore 130.

In an embodiment, the metadata store 112 stores one or more mappingsthat map entities in the domain model to data stored in the data store130. Additionally or alternatively, the metadata store 112 storesmetadata information describing the domain model.

In an embodiment, metadata service 110 comprises program instructionsthat are programmed or configured to perform a variety of functionsneeded for managing the domain model and associated metadata, includingbut not limited to: receiving requests for metadata and/or mappings,receiving requests to generate metadata and/or mappings, retrievingmetadata and/or mappings from metadata storage 112, sending metadataand/or mappings to the client computer 102, generating metadata and/ormappings, storing metadata and/or mappings to metadata storage 112,modifying metadata and/or mappings stored in metadata storage 112, andany other aspects of embodiments described herein.

Additionally or alternatively, metadata service 110 provides an API thatmay be accessed, for example, by a web browser or client applicationrunning on client computer, to perform the functions related to managingthe domain model and associated metadata.

In an embodiment, the metadata service 110 provides data describingwhich types of entities are stored in a backend data storage, such as indata store 130, and which property and association types the entitieshave. The metadata service 110 may provide the data in response to arequest from a client computer.

Additionally or alternatively, the metadata service provides datadescribing a mapping between the entities stored in the backend datastorage and the domain model. The mapping may be used by a backend dataservice, such as data service 120, to translate queries based on thedomain model into queries for the data store 130.

In an embodiment, the metadata service 110 receives requests to definenew entities and/or properties in the domain model. In response toreceiving a request specifying new entity and/or property definitions,the metadata service 110 updates the metadata describing the domainmodel with the new entity and/or property definitions.

In an embodiment, in response to receiving a request specifying newentity and/or property definitions, the metadata service 110 generatesthe corresponding required storage structures in the data store 130.Additionally or alternatively, the metadata service 110 may generate orupdate a mapping to map the new entities and/or properties in the domainmodel to the generated storage structures. When a request makesamendments to the metadata (i.e., adding a new field to an existingtable or adding a new entity), generation of the corresponding tablesand mapping information is triggered. For example, assume the datastorage comprises a database. The metadata service 110 may receive arequest specifying new fields or entities for the domain model and causecorresponding tables and columns to be created in a database in datastore 130.

As another example when a new attribute is created, the metadata service110 looks up the database type corresponding to the data type defined inthe domain model (e.g. for a string in the domain model, a databasefield of type VARCHAR will be created). For an entity, a new table maybe created with a column for each attribute and an association with acardinality of one. In the latter case, the column may contain theforeign key of the associated entity.

This allows a backend to be created for an entirely new applicationwithout the overhead of writing, testing and deploying code.

2.3 Data Service

In an embodiment, the data store 130 is a data storage subsystemconsisting of programs and data that is stored on any suitable storagedevice such as one or more hard disk drives, memories, or any otherelectronic digital data recording device configured to store data.Although data store 130 is depicted as a single device in FIG. 1, datastore 130 may span multiple devices located in one or more physicallocations. For example, data store 130 may include one or nodes locatedat one or more data warehouses. In some embodiments, data store 130 maybe located on the same device or devices as metadata store 112, metadataservice 110, and/or data service 120. Alternatively, data store 130 maybe located on a separate device or devices from metadata store 112,metadata service 110, and/or data service 120.

The data stored in the data store 130 may be in any data and/or storageformat, such as a relational database, a columnar database, a noSQLdatabase, one or more flat files, and the like. Additionally oralternatively, the data store 130 may comprise data stored in aplurality of respective formats. Additionally or alternatively, the datastore 130 may be communicatively connected with other components, eitherdirectly or indirectly, such as one or more third party data suppliers.Data store 130 may be configured to receive or retrieve requested datafrom the one or more third party data suppliers.

In an embodiment, data service 120 comprises program instructions thatare programmed or configured to perform a variety of functions neededfor processing requests for data, including but not limited to:receiving requests from client computer 102, translating requests into aquery language, sending translated queries to the data store 130,receiving data from data store 130, translating the received data into arequested format, sending query results to client computer 102, and anyother aspects of embodiments described herein.

Additionally or alternatively, data service 120 provides an API that maybe accessed, for example, by a web browser or client application runningon client computer 102, to perform the functions related to processingdata requests.

In an embodiment, data service 120 comprises a plurality of end pointsfor receiving requests and providing data to frontend services andapplications.

In an embodiment, a plurality of end points each use the same requestlanguage and translation process, but each end point may differ in theway the results are encoded and transported to the consumer. In anembodiment, a property type of the requested data defines the dataformat, and a different end point would be used depending on the dataformat. For example, a first end point would be called for a binary dataformat and a second end point may be called for a compressed dataformat.

In an embodiment, to extract large data sets, for example to retrieveentire portfolios for model execution, one or more separate end pointsmay return the requested data in specific, optimized formats. Forexample, the system may return requested data as Parquet files forprocessing with Spark.

In the illustrated embodiment, data service 120 comprises requesttranslator 122, storage optimizer 124, and statement cache 126.

In an embodiment, query execution goes through a translation process atdata service 120. Incoming requests from client computer 102 areformulated in a first request language, such as a general requestlanguage or a declarative query language. The requests are formulatedagainst the domain model, rather than the underlying data stored in datastore 130. That is, the queries do not rely on knowledge of the datastructure or format of the data it is requesting.

In response to receiving the request, the request translator 122translates the requests into database management engine-specificrequests based on the underlying storage structure and data format ofdata store 130. The translated request is sent to data store 130 andexecuted at data store 130. For example, request translator 122 mayreceive a request in a general request language and translate therequest into a SQL query to be executed by data store 130 to retrievedata from a database.

The purpose of the general request language is to allow the execution ofcomplex queries on data in a single client-to-server round-trip. In anembodiment, the overall syntax of the general request language issimilar to declarative query languages such as SQL, but instead of JOINstatements, it uses a more compact notation to describe the compositionof result sets extending over multiple entity types and theiraggregations. The compact notation is referred to herein as the“navigation path.”

As an example, a request in the general request language may have theform:

SELECT <field list> FROM <navigation path> WHERE <condition> [GROUP-BY<grouping>] [ORDER-BY <order field>] [TOP <number of rows to return>]

The navigation path consists of a start entity type followed by asequence of associations to indicate which other entity types are beingjoined. An example association may be:

customer→order→item

In the above example, customer entity is joined with order entity anditem entity.

Additionally, a navigation path can also include aggregation over allrecords associated with one entity. As an example, the request:

customer→order→item) as or

will produce one row per order, which contains selected fields of thecustomer, the order, and aggregated fields of all items associated withthe order.

In an embodiment, storage optimizer 124 is programmed or configured totrack usage patterns based on requests received by the data service 120.As described in further detail below, based on the usage patterns, thestorage optimizer 124 determines whether to optimize the data stored indata storage. Optimizing the data may include, for example, generatingand storing one or more materialized views, saving one or morepre-defined navigation paths, field selections, and other requeststatements, modifying the structure of the stored data, and etc. Abenefit of the present system is that it provides a self-optimizingbackend that generates data structures that are best for a client orcustomer's usage pattern, without involving a system administrator orother user.

In an embodiment, the data service 120 includes a statement cache 126.The statement cache 126 may be programmed or configured to store orcache a copy of previously retrieved results. The statement cache 126may store data mapping the text of a request to a stored or cached copypreviously retrieved results. When a request is received, the dataservice 120 may determine based on the mapping that the correspondingresult is stored in the statement cache. In response to determining thatthe corresponding result has been cached, the request translation andquery execution are by-passed, and the corresponding cache content isretrieved from the statement cache and returned as response to therequest. In an embodiment, cached requests and responses are removedfrom the cache whenever the corresponding data in the data store ismodified.

3.0 Domain Model Entity Creation

In an embodiment, a developer intending to develop a new applicationprovides a technology-agnostic model (i.e., domain model) of theentities his application will manage to the computer system. Themetadata service 110 may receive the domain model and generate metadatadescribing the domain model. Additionally, the metadata service 110 maycause data store 130 to generate data entities, attributes, and/orassociations corresponding to the domain model.

In an embodiment, the domain model is provided in a format according toa metadata API. Additionally or alternatively, the creation of thatdomain model is facilitated by a user interface for viewing, creating,and/or modifying a domain model.

In an embodiment, the domain model comprises an ID and a name of anentity type. Additionally, the domain model may comprise a plurality ofentity attributes and a plurality of entity associations. As an example,one entity could be an order in a retail scenario. An example domainmodel for the order entity may be:

{“entity”: “order”, “displayname”: “Order”, “attributes”: [ “id”:{“datatype”: “long”, “displaytext”: “ID”}, “total”: {“datatype”:“currency”, “displaytext”: “Total”} ], “associations”: [ {“id”:“customer”, “target”: “customer”, “cardinality”: “single”}, {“id”:“item”, “target”: “lineitem”, “cardinality”: “multiple”} ]}

FIG. 2 illustrates example steps for creating a domain model.

At step 202, metadata service 110 receives a request to create or modifya domain model entity from client computer 102. For the purpose ofillustrating a clear example, assume the client computer 102 sends arequest to create the above example domain model to the metadata service110.

At step 204, the metadata service generates mapping information fortranslating from the domain model to a data store representation.Generating the mapping information may comprise determining, for eachentity, attribute, and/or association, a corresponding data entity,attribute information, and/or associations.

In an embodiment, generating the mapping information comprisesdetermining the data format in which data is stored in data store 130.For example, if data store 130 stores data in a relational database, themapping information may map domain model entities to database tables,attributes to columns, and associations to foreign keys.

Referring to the above example, the domain model with added mappinginformation may be:

{“entity”: “order”,  “displayname”: “Order”,  “table”:“client_a.tb_order”,  “attributes”: [   “id”: {“datatype”: “long”“displaytext”: “ID”, “column”: “id”},   “total”: {“datatype”:“currency”, “displaytext”: “Total”, “column”: “total”}  ], “associations”: [   {“id”: “customer”, “target”: “customer”,“cardinality”: “single”,  “join”: “JOIN $customer$ ON $customer$.id =$order$.customerid”},   {“id”: “item”, “target”: “lineitem”,“cardinality”: multiple, “join”:   “JOIN $lineitem$ ON$lineitem$.orderid = $order$.id”}  ]}

In step 206, the metadata and/or the mapping information are stored in ametadata store. In the present example, the domain model, amended withthe mapping information, is stored in the metadata store 112.

In step 208, data store elements are created based on the domain model.In an embodiment, the metadata service 112 generates statements forcreating the target representation in the data store 130. The statementsare executed at the data store 130 to generate the corresponding dataentities. An example statement for generating the data entities may be:

CREATE TABLE client_a.tb_order( id BIGINT, total DECIMAL(12,4),customerid BIGINT );

After the above metadata creation process, the developer is able todevelop, test, and put to productive use, a new application that usesthe data service 120 as a backend. If the application includes a userinterface, entities and attributes shown to the user can be dynamicallyderived by calls to the metadata service 110. This is particularlyuseful for table views in a user interface, where the columns to beshown can be dynamically determined without impacting the layout. Whenadditional fields are added to an entity at a later point in time, theuser interface may automatically adapt without any changes to the codeby requesting updated metadata that describes the updated domain model.

4.0 Data Request Handling

To retrieve data from data storage 130, a frontend application orservice sends a request to the data service 120. In contrast toconventional REST services, the request may be specified in theabove-mentioned general request language.

As an example, assume a user wants to answer the following question:“For each customer, how many orders contain articles of the “sports”category, what is the total number and the revenue from these articles?”

The domain model, that is the public part of the metadata, contains theentities “customer,” “order,” “lineitem” and “article” and theirrespective fields (e.g. “id,” “name,” “price,” “category”). It alsocontains the information that the customer has an association named“order” which points at a multiplicity of orders, that an order has anassociation “item” pointing at a multiplicity of line items and that aline item has an association “article” pointing at one article.

In an embodiment, the client computer may send a request to metadataservice 110 for the metadata describing the domain model. In response toreceiving the request, the metadata service 110 retrieves the requestedmetadata and sends it to the client computer. Additionally oralternatively, the request may be sent to the data service 120. Therequest may be in the general request language. Rather than translatingthe request and sending it to the data store, the data service maydetermine that it is a request for metadata and send the request to themetadata service. Using the received metadata, a user is able toformulate a request based on the domain model.

FIG. 3 illustrates an example process for processing a request for data.At step 302, a request for data is received in a first query language,such as the general request language. For the purpose of illustrating aclear example, assume the request is for the question, “For eachcustomer, how many orders contain articles of the “sports” category,what is the total number and the revenue from these articles?” FIG. 4illustrates an example request 400 for this question, based on thedomain model described above.

4.1 Request Translation

At step 304, in response to receiving the request, the data service 120translates the request to a query language supported by the data storage130. The translated request is used to retrieve the requested data fromdata storage 130.

In an embodiment, data storage 130 comprises data stored in a pluralityof formats. For example, a first set of data in data storage 130 maysupport SQL queries while a second set of data in data storage 130 maysupport GraphQL queries. The query language into which the request istranslated may be based on which set of data the request is targetedtowards.

FIG. 5 illustrates an example process for translating a request from thegeneral request language to a data specific query language. In anembodiment, the request is transformed into a single corresponding querystatement. In other embodiments, the request may be divided into aplurality of queries.

As an example, a request may target a portion of data stored in a firstdata store and/or format and a portion of data stored in a second datastore and/or format. The request may be transformed into a first querystatement corresponding to the first data store and/or format and asecond query statement corresponding to the second data store and/orformat.

At step 502, the request is parsed to generate an abstract syntax tree.In an embodiment, the request is syntactically validated and an abstractsyntax tree (AST) of keywords and identifiers is created. In the AST,the identifiers for entities and fields are not yet connected to anyparticular meaning (i.e., data in the data store).

FIG. 6 illustrates a block diagram depicting an example abstract syntaxtree 600 corresponding to request 400. In the illustrated example, therequest is divided into three components: field selection, entity path,and condition. Field selection includes portions of the request thatidentify particular domain model fields, such as “customer.name,”“order.id,” “article.id,” etc.

Entity path includes portions of the request that identify a particularnavigation path. In the illustrated example, “customer” has anassociation named “order” which points at a multiplicity of orders, thatan order has an association “item” pointing at a multiplicity of lineitems, and that a line item has an association “article” pointing at anarticle. The AST also indicates that the “item” and “article”association are aggregated as “it,” and the “it” and “order” associationare aggregated as “or.”

Condition specifies filters to be applied to the data. In theillustrated example, the condition is “article” whose “category” fieldis equal to “sports.”

At step 504, the general structure of the request is derived from the“FROM” part and mapped to a structural model. This includes the semanticvalidation of the entities and associations.

FIG. 7 illustrates an example structural model 700 based on request 400.

In an embodiment, several lookup structures are created. A global“scope” lookup maps the aliases given for the different aggregationlevels of the navigation path (e.g., “or” and “it” for the order andline item level respectively) to the respective parts of the structuralmodel. For each of these parts, a lookup structure for field annotationsis maintained which maps identifiers for fields used in the request tofield annotations.

At step 506, the entity models corresponding to the identifiers arelooked up in the metadata and linked to the respective parts in thestructural model. In an embodiment, looking up the corresponding entitymodels in the metadata comprises requesting or retrieving the mappingfrom metadata store 112.

In an embodiment, the field annotations are created when the “SELECT”part of the request is processed. A field annotation points to thecorresponding meta data of the respective field (data type and mappingto database field or function) and contains the query language aliasthat has been generated in the scope of this specific request. Thegeneration of unique query language aliases for selected fields (e.g.,“f1”, “f2”, “f3”) and tables (“t1”, “t2”) prevents potential nameclashes in the generated queries. The lookup structures ensure that alloccurrences of a field will eventually refer to the same alias.

FIG. 8 illustrates example annotations 800 for structural model 700. Thecreation of field annotations for aggregations traversing multiplelevels in the structural model is illustrated for the portion of therequest, “SUM(COUNT(it→article.id)).”

In an embodiment, the annotation process starts at the lowest level ofthe aggregation structure, i.e. with the innermost term in theexpression “it→article.” The request alias “it” identifies the part ofthe structural model where the unaggregated field is located. Associatedto this part of the structural model there is the entity model of“article,” with the property model for “id,” including the correspondingdatabase field. A field annotation for the “COUNT” of the database fieldis created, tagged with an SQL alias “f6” and linked to the respectivepart of the structure model. The process moves simultaneously upwards inthe brace hierarchy of the expression “SUM(COUNT(it→article.id))” andthe structural model. A new field annotation for SUM(f6) is created andlinked to the top level of the structure model.

At step 508, after the creation of field annotations for all fieldsmentioned in the SELECT clause and WHERE conditions is completed, theassembly of the final query statement is performed. The statement iscomposed by merging the keywords for the respective constructs with thesymbols from the field and table annotations.

FIG. 9 illustrates an example a query language request 900, into whichrequest 400 was translated. In the illustrated embodiment, the request400 has been translated into a SQL query.

4.1 Data Retrieval

Referring again to FIG. 3, after the request is translated, the methodproceeds to step 306. In step 306, the translated statement is sent tothe data store. The resulting query language statement is executed onthe data store.

In step 308, data is received from the data store. The received data maybe in any format in which the data was stored. In an embodiment, if thedata is stored in multiple formats and/or locations, multiple data setsmay be received. Each data set may be in a particular data format.

In step 310, the received data is transformed into a transport format.The transport format may be, for example, JSON, XML, or any othersuitable format for providing query results to a frontend application.In an embodiment, if multiple data sets are received, each data set maybe transformed into the same transport format.

In an embodiment, the data service 120 comprises a plurality of endpoints. Each end point may be configured to transform the data into adifferent format, and the particular format into which the results aretransformed varies depending on the end point that is processing therequest.

In step 312, the requested data is sent to the frontend applicationand/or service that sent the request. In an embodiment, the queryresults may be returned as simple result sets. Additionally oralternatively, for larger results, the system may support result paging.The data service 120 may sent the requested data as a plurality ofresult sets.

5.0 Optimizations

In an embodiment, the data service records the frequency and/or totaltime consumed for requests. When a certain threshold of frequency and/ortotal time consumed for requests is passed during a specified timeinterval, the storage optimizer may modify the data store to betterserve recorded usage patterns. In an embodiment, the storage optimizermay create indexes and materialized database views for the whole orparts of soft-coded views.

Referring to the above example, the request or similar requests may besent many times. The request may therefore comprise one or more viewdefinition statements. A view definition statement defines a shorthandexpression for a navigation path (i.e. the FROM portion) and any fieldselections.

An example view definition statement may be:

DEFINE VIEW myview PATH customer−>#(order−>#(item−>article) AS it) AS orFIELD COUNT(or−>order.id) AS ordercount FIELD SUM(SUM(it−>item.price) ASrevenue FIELD SUM(COUNT(it−>article.id)) AS numofarticles END VIEW

Thus, rather than including the navigation path and field selections inthe request, the request may substitute “myview” for the navigation pathand field selections.

In an embodiment, the view definition statement may be stored as aconstant in the frontend application and/or service, and concatenated asprefix to each request sent by the frontend application and/or service.This makes the requests short and expressive, without compromisingflexibility.

In an embodiment, for requests that don't have a significant impact onthe system performance, the request translator may substitute theshorthand view with the corresponding statement. For example, therequest translator may substitute the short-hand “myview” with the PATHexpression and “ordercount,” “revenue,” etc. by the corresponding FIELDexpressions.

Additionally or alternatively, the data service may record the timeneeded for processing the request and associates the information withthe view, conditions, and/or field selections used in the request. Therecorded information is also referred to herein as a “usage pattern.”

In an embodiment, based on the usage pattern, the data service maydetermine whether to optimize the storage of data related to aparticular view. The determination may be based on, for example, thefrequency of use of the view, the amount of time used to processrequests for the view, the cost of updating the data, the cost ofupdating a materialized (stored view), the number of read requests forthe data, the number of write requests for the data, the frequency ofmodifications to the data, the cost of reading and/or writingunoptimized data, and the like.

As an example, based on the frequency of use for all requests using aspecific view, the data service may determine that the specific view isa target for optimization. In response, the data service mayautomatically invoke the storage optimizer, which modifies the datastore representation corresponding to the view, in order to achievebetter performance metrics. The storage optimizer has access to therecorded information about all past requests that included a view,including the used field selections, filter conditions and theirrespective incidence counts and/or frequencies.

In an embodiment, an optimization includes adding indexes for foreignkeys that are frequently used in JOIN clauses or for fields frequentlyused in WHERE conditions.

In an embodiment, for views involving many JOIN clauses, one or morematerialized views can be created. The one or more materialized viewsmay be stored in data store or in memory accessible by data service.

In an embodiment, the view definition for a materialized view is derivedby translating PATH part of the soft-coded view definition. However, inthe case of multi-level aggregations as in the example described above,the transition from a soft-coded view in the request language to amaterialized view means that conditions defined the aggregatedsub-selections cannot be changed in subsequent requests to thismaterialized view. Referring to the above example, the condition, “WHEREt4.category=‘sports’” is in the innermost aggregated sub-selection ofthe view. The materialized view may be used in lieu of the full querystatements only when a filter on the article category “sports” isincluded in the request. In an embodiment, if conditions in aggregatedsub-selections have a very small variation for the filter value, onematerialized view per filter value can be created.

Additionally or alternatively, optimization may comprise identifying asub-selection in a complex view that can be materialized withoutaffecting any of the used filter criteria or aggregations.

In an embodiment, the storage optimizer calculates a cost estimate pertime interval from the observed duration of unoptimized calls to therespective database parts and the observed frequency with which write orchange requests to he respective tables and relevant fields are sent.Materialized views need to be updated when data changes, which consumescomputing resources and thus can slow down write operations. Amaterialized view has to be re-calculated when data matching its filtercriterion has been added or changed. The performance impact fromupdating materialized views is taken into account during theoptimization. In an embodiment, the storage optimizer may select anoptimization strategy from a plurality of different optimizationstrategies based on the observed usage patterns and cost estimates.

In an embodiment, the choice of optimization strategies is based onrelating the predicted average cost for write operations per time to thepredicted time savings for read operations. The predicted time savingsare calculated from the observed cost of unoptimized read operations,the number of rows and a heuristically determined factor relating theread time for materialized views to the number of rows.

In an embodiment, for frequently used requests, the data service mayperform multiple optimizations in parallel or over a period of time(e.g., partial or full materialized views or indexes), and route afraction of the requests to a particular optimization. The data servicemay measure which optimization yields the best performance improvements.This approach is analogous to performing AB tests in UI development inorder to maximize the popularity of web pages.

Additionally or alternatively, machine learning algorithms can beapplied to correlate the structure of requests to the most successfuldata store optimization strategy.

6.0 Implementation Example—Hardware Overview

According to one embodiment, the techniques described herein areimplemented by at least one computing device. The techniques may beimplemented in whole or in part using a combination of at least oneserver computer and/or other computing devices that are coupled using anetwork, such as a packet data network. The computing devices may behard-wired to perform the techniques, or may include digital electronicdevices such as at least one application-specific integrated circuit(ASIC) or field programmable gate array (FPGA) that is persistentlyprogrammed to perform the techniques, or may include at least onegeneral purpose hardware processor programmed to perform the techniquespursuant to program instructions in firmware, memory, other storage, ora combination. Such computing devices may also combine custom hard-wiredlogic, ASICs, or FPGAs with custom programming to accomplish thedescribed techniques. The computing devices may be server computers,workstations, personal computers, portable computer systems, handhelddevices, mobile computing devices, wearable devices, body mounted orimplantable devices, smartphones, smart appliances, internetworkingdevices, autonomous or semi-autonomous devices such as robots orunmanned ground or aerial vehicles, any other electronic device thatincorporates hard-wired and/or program logic to implement the describedtechniques, one or more virtual computing machines or instances in adata center, and/or a network of server computers and/or personalcomputers.

FIG. 10 is a block diagram that illustrates an example computing deviceillustrated with a computer system 1000 with which an embodiment may beimplemented. In the example of FIG. 10, the computer system 1000 andinstructions for implementing the disclosed technologies in hardware,software, or a combination of hardware and software, are representedschematically, for example as boxes and circles, at the same level ofdetail that is commonly used by persons of ordinary skill in the art towhich this disclosure pertains for communicating about computerarchitecture and computer systems implementations. The computer systemmay be, for instance, a distributed computer with the processing handledby one or more processors.

Computer system 1000 includes an input/output (I/O) subsystem 1002 whichmay include a bus and/or other communication mechanism(s) forcommunicating information and/or instructions between the components ofthe computer system 1000 over electronic signal paths. The I/O subsystem1002 may include an I/O controller, a memory controller and at least oneI/O port. The electronic signal paths are represented schematically inthe drawings, for example as lines, unidirectional arrows, orbidirectional arrows.

At least one hardware processor 1004 is coupled to I/O subsystem 1002for processing information and instructions. Hardware processor 1004 mayinclude, for example, a general-purpose microprocessor ormicrocontroller and/or a special-purpose microprocessor such as anembedded system or a graphics processing unit (GPU) or a digital signalprocessor or ARM processor. Processor 1004 may comprise an integratedarithmetic logic unit (ALU) or may be coupled to a separate ALU.

Computer system 1000 includes one or more units of memory 1006, such asa main memory, which is coupled to I/O subsystem 1002 for electronicallydigitally storing data and instructions to be executed by processor1004. Memory 1006 may include volatile memory such as various forms ofrandom-access memory (RAM) or other dynamic storage device. Memory 1006also may be used for storing temporary variables or other intermediateinformation during execution of instructions to be executed by processor1004. Such instructions, when stored in non-transitory computer-readablestorage media accessible to processor 1004, can render computer system1000 into a special-purpose machine that is customized to perform theoperations specified in the instructions.

Computer system 1000 further includes non-volatile memory such as readonly memory (ROM) 1008 or other static storage device coupled to I/Osubsystem 1002 for storing information and instructions for processor1004. The ROM 1008 may include various forms of programmable ROM (PROM)such as erasable PROM (EPROM) or electrically erasable PROM (EEPROM). Aunit of persistent storage 1010 may include various forms ofnon-volatile RAM (NVRAM), such as FLASH memory, or solid-state storage,magnetic disk or optical disk such as CD-ROM or DVD-ROM and may becoupled to I/O subsystem 1002 for storing information and instructions.Storage 1010 is an example of a non-transitory computer-readable mediumthat may be used to store instructions and data which when executed bythe processor 1004 cause performing computer-implemented methods toexecute the techniques herein.

The instructions in memory 1006, ROM 1008 or storage 1010 may compriseone or more sets of instructions that are organized as modules, methods,objects, functions, routines, or calls. The instructions may beorganized as one or more computer programs, operating system services,or application programs including mobile apps. The instructions maycomprise an operating system and/or system software; one or morelibraries to support multimedia, programming or other functions; dataprotocol instructions or stacks to implement TCP/IP, HTTP or othercommunication protocols; file format processing instructions to parse orrender files coded using HTML, XML, JPEG, MPEG or PNG; user interfaceinstructions to render or interpret commands for a graphical userinterface (GUI), command-line interface or text user interface;application software such as an office suite, internet accessapplications, design and manufacturing applications, graphicsapplications, audio applications, software engineering applications,educational applications, games or miscellaneous applications. Theinstructions may implement a web server, web application server or webclient. The instructions may be organized as a presentation layer,application layer and data storage layer such as a relational databasesystem using structured query language (SQL) or no SQL, an object store,a graph database, a flat file system or other data storage.

Computer system 1000 may be coupled via I/O subsystem 1002 to at leastone output device 1012. In one embodiment, output device 1012 is adigital computer display. Examples of a display that may be used invarious embodiments include a touch screen display or a light-emittingdiode (LED) display or a liquid crystal display (LCD) or an e-paperdisplay. Computer system 1000 may include other type(s) of outputdevices 1012, alternatively or in addition to a display device. Examplesof other output devices 1012 include printers, ticket printers,plotters, projectors, sound cards or video cards, speakers, buzzers orpiezoelectric devices or other audible devices, lamps or LED or LCDindicators, haptic devices, actuators or servos.

At least one input device 1014 is coupled to I/O subsystem 1002 forcommunicating signals, data, command selections or gestures to processor1004. Examples of input devices 1014 include touch screens, microphones,still and video digital cameras, alphanumeric and other keys, keypads,keyboards, graphics tablets, image scanners, joysticks, clocks,switches, buttons, dials, slides, and/or various types of sensors suchas force sensors, motion sensors, heat sensors, accelerometers,gyroscopes, and inertial measurement unit (IMU) sensors and/or varioustypes of transceivers such as wireless, such as cellular or Wi-Fi, radiofrequency (RF) or infrared (IR) transceivers and Global PositioningSystem (GPS) transceivers.

Another type of input device is a control device 1016, which may performcursor control or other automated control functions such as navigationin a graphical interface on a display screen, alternatively or inaddition to input functions. Control device 1016 may be a touchpad, amouse, a trackball, or cursor direction keys for communicating directioninformation and command selections to processor 1004 and for controllingcursor movement on display 1012. The input device may have at least twodegrees of freedom in two axes, a first axis (e.g., x) and a second axis(e.g., y), that allows the device to specify positions in a plane.Another type of input device is a wired, wireless, or optical controldevice such as a joystick, wand, console, steering wheel, pedal,gearshift mechanism or other type of control device. An input device1014 may include a combination of multiple different input devices, suchas a video camera and a depth sensor.

In another embodiment, computer system 1000 may comprise an interne ofthings (IoT) device in which one or more of the output device 1012,input device 1014, and control device 1016 are omitted. Or, in such anembodiment, the input device 1014 may comprise one or more cameras,motion detectors, thermometers, microphones, seismic detectors, othersensors or detectors, measurement devices or encoders and the outputdevice 1012 may comprise a special-purpose display such as a single-lineLED or LCD display, one or more indicators, a display panel, a meter, avalve, a solenoid, an actuator or a servo.

When computer system 1000 is a mobile computing device, input device1014 may comprise a global positioning system (GPS) receiver coupled toa GPS module that is capable of triangulating to a plurality of GPSsatellites, determining and generating geo-location or position datasuch as latitude-longitude values for a geophysical location of thecomputer system 1000. Output device 1012 may include hardware, software,firmware and interfaces for generating position reporting packets,notifications, pulse or heartbeat signals, or other recurring datatransmissions that specify a position of the computer system 1000, aloneor in combination with other application-specific data, directed towardhost 1024 or server 1030.

Computer system 1000 may implement the techniques described herein usingcustomized hard-wired logic, at least one ASIC or FPGA, firmware and/orprogram instructions or logic which when loaded and used or executed incombination with the computer system causes or programs the computersystem to operate as a special-purpose machine. According to oneembodiment, the techniques herein are performed by computer system 1000in response to processor 1004 executing at least one sequence of atleast one instruction contained in main memory 1006. Such instructionsmay be read into main memory 1006 from another storage medium, such asstorage 1010. Execution of the sequences of instructions contained inmain memory 1006 causes processor 1004 to perform the process stepsdescribed herein. In alternative embodiments, hard-wired circuitry maybe used in place of or in combination with software instructions.

The term “storage media” as used herein refers to any non-transitorymedia that store data and/or instructions that cause a machine tooperation in a specific fashion. Such storage media may comprisenon-volatile media and/or volatile media. Non-volatile media includes,for example, optical or magnetic disks, such as storage 1010. Volatilemedia includes dynamic memory, such as memory 1006. Common forms ofstorage media include, for example, a hard disk, solid state drive,flash drive, magnetic data storage medium, any optical or physical datastorage medium, memory chip, or the like.

Storage media is distinct from but may be used in conjunction withtransmission media. Transmission media participates in transferringinformation between storage media. For example, transmission mediaincludes coaxial cables, copper wire and fiber optics, including thewires that comprise a bus of I/O subsystem 1002. Transmission media canalso take the form of acoustic or light waves, such as those generatedduring radio-wave and infra-red data communications.

Various forms of media may be involved in carrying at least one sequenceof at least one instruction to processor 1004 for execution. Forexample, the instructions may initially be carried on a magnetic disk orsolid-state drive of a remote computer. The remote computer can load theinstructions into its dynamic memory and send the instructions over acommunication link such as a fiber optic or coaxial cable or telephoneline using a modem. A modem or router local to computer system 1000 canreceive the data on the communication link and convert the data to aformat that can be read by computer system 1000. For instance, areceiver such as a radio frequency antenna or an infrared detector canreceive the data carried in a wireless or optical signal and appropriatecircuitry can provide the data to I/O subsystem 1002 such as place thedata on a bus. I/O subsystem 1002 carries the data to memory 1006, fromwhich processor 1004 retrieves and executes the instructions. Theinstructions received by memory 1006 may optionally be stored on storage1010 either before or after execution by processor 1004.

Computer system 1000 also includes a communication interface 1018coupled to bus 1002. Communication interface 1018 provides a two-waydata communication coupling to network link(s) 1020 that are directly orindirectly connected to at least one communication networks, such as anetwork 1022 or a public or private cloud on the Internet. For example,communication interface 1018 may be an Ethernet networking interface,integrated-services digital network (ISDN) card, cable modem, satellitemodem, or a modem to provide a data communication connection to acorresponding type of communications line, for example an Ethernet cableor a metal cable of any kind or a fiber-optic line or a telephone line.Network 1022 broadly represents a local area network (LAN), wide-areanetwork (WAN), campus network, internetwork or any combination thereof.Communication interface 1018 may comprise a LAN card to provide a datacommunication connection to a compatible LAN, or a cellularradiotelephone interface that is wired to send or receive cellular dataaccording to cellular radiotelephone wireless networking standards, or asatellite radio interface that is wired to send or receive digital dataaccording to satellite wireless networking standards. In any suchimplementation, communication interface 1018 sends and receiveselectrical, electromagnetic or optical signals over signal paths thatcarry digital data streams representing various types of information.

Network link 1020 typically provides electrical, electromagnetic, oroptical data communication directly or through at least one network toother data devices, using, for example, satellite, cellular, Wi-Fi, orBLUETOOTH technology. For example, network link 1020 may provide aconnection through a network 1022 to a host computer 1024.

Furthermore, network link 1020 may provide a connection through network1022 or to other computing devices via internetworking devices and/orcomputers that are operated by an Internet Service Provider (ISP) 1026.ISP 1026 provides data communication services through a world-widepacket data communication network represented as internet 1028. A servercomputer 1030 may be coupled to internet 1028. Server 1030 broadlyrepresents any computer, data center, virtual machine or virtualcomputing instance with or without a hypervisor, or computer executing acontainerized program system such as DOCKER or KUBERNETES. Server 1030may represent an electronic digital service that is implemented usingmore than one computer or instance and that is accessed and used bytransmitting web services requests, uniform resource locator (URL)strings with parameters in HTTP payloads, API calls, app services calls,or other service calls. Computer system 1000 and server 1030 may formelements of a distributed computing system that includes othercomputers, a processing cluster, server farm or other organization ofcomputers that cooperate to perform tasks or execute applications orservices. Server 1030 may comprise one or more sets of instructions thatare organized as modules, methods, objects, functions, routines, orcalls. The instructions may be organized as one or more computerprograms, operating system services, or application programs includingmobile apps. The instructions may comprise an operating system and/orsystem software; one or more libraries to support multimedia,programming or other functions; data protocol instructions or stacks toimplement TCP/IP, HTTP or other communication protocols; file formatprocessing instructions to parse or render files coded using HTML, XML,JPEG, MPEG or PNG; user interface instructions to render or interpretcommands for a graphical user interface (GUI), command-line interface ortext user interface; application software such as an office suite,internet access applications, design and manufacturing applications,graphics applications, audio applications, software engineeringapplications, educational applications, games or miscellaneousapplications. Server 1030 may comprise a web application server thathosts a presentation layer, application layer and data storage layersuch as a relational database system using structured query language(SQL) or no SQL, an object store, a graph database, a flat file systemor other data storage.

Computer system 1000 can send messages and receive data andinstructions, including program code, through the network(s), networklink 1020 and communication interface 1018. In the Internet example, aserver 1030 might transmit a requested code for an application programthrough Internet 1028, ISP 1026, local network 1022 and communicationinterface 1018. The received code may be executed by processor 1004 asit is received, and/or stored in storage 1010, or other non-volatilestorage for later execution.

The execution of instructions as described in this section may implementa process in the form of an instance of a computer program that is beingexecuted, and consisting of program code and its current activity.Depending on the operating system (OS), a process may be made up ofmultiple threads of execution that execute instructions concurrently. Inthis context, a computer program is a passive collection ofinstructions, while a process may be the actual execution of thoseinstructions. Several processes may be associated with the same program;for example, opening up several instances of the same program oftenmeans more than one process is being executed. Multitasking may beimplemented to allow multiple processes to share processor 1004. Whileeach processor 1004 or core of the processor executes a single task at atime, computer system 1000 may be programmed to implement multitaskingto allow each processor to switch between tasks that are being executedwithout having to wait for each task to finish. In an embodiment,switches may be performed when tasks perform input/output operations,when a task indicates that it can be switched, or on hardwareinterrupts. Time-sharing may be implemented to allow fast response forinteractive user applications by rapidly performing context switches toprovide the appearance of concurrent execution of multiple processessimultaneously. In an embodiment, for security and reliability, anoperating system may prevent direct communication between independentprocesses, providing strictly mediated and controlled inter-processcommunication functionality.

In the foregoing specification, embodiments of the invention have beendescribed with reference to numerous specific details that may vary fromimplementation to implementation. The specification and drawings are,accordingly, to be regarded in an illustrative rather than a restrictivesense. The sole and exclusive indicator of the scope of the invention,and what is intended by the applicants to be the scope of the invention,is the literal and equivalent scope of the set of claims that issue fromthis application, in the specific form in which such claims issue,including any subsequent correction.

7.0 Items

The present method may be implemented in a single computing device likea server or a platform or distributed over a computer system asillustrated in FIG. 6. Such a computer system according to a first itemcomprises the following:

one or more processors;

one or more non-transitory computer-readable media storing instructionswhich, when executed by the one or more processors, cause:

generating and storing metadata that maps a domain model to data storedin a data store, wherein the domain model describes the data andrelationships between the data;

receiving, from a client application, a request for data stored in thedata store, wherein the request is in a first query language;

translating the request into one or more queries based on the metadata,wherein the one or more queries are in a second query language;

sending the one or more queries to the data store;

receiving a first result set from the data store, based on the datastore executing the one or more queries.

A second item according to the first item, wherein the first result setis in a first data format, further comprises instructions which, whenexecuted using the one or more processors, cause:

transforming the first result set to a second data format;

sending the first result set in the second data format to the clientapplication.

A third item according to one of the previous items, wherein the datastore is configured to store the data using a plurality of data formats,further comprises instructions which, when executed using the one ormore processors, cause:

receiving a second result set in a third data format, wherein the thirddata format is different from the first data format and the second dataformat;

transforming the second result set to the second data format andcombining the second result set with the first result set;

sending the combined result set to the client application.

A fourth item according to one of the previous items, wherein the datastore is one of a plurality of different data stores, wherein each datastore of the plurality of different data stores is configured to receiverequests in a particular query language, further comprises instructionswhich, when executed using the one or more processors, cause selectingthe second query language based on the data store for which the requestwas received.

A fifth item according to one of the previous item, comprises the firstquery language being a general request language, and the second querylanguage being a data store specific query language.

A sixth item according to one of the previous items further comprisesinstructions which, when executed using the one or more processors,cause:

prior receiving a request for data, sending to the client application,metadata that describes the domain model.

A seventh item according to one of the previous items further comprisesinstructions which, when executed using the one or more processors,cause:

receiving a plurality of requests for data;

storing usage information associated with the plurality of requests;

based on the usage information, determining whether to optimize the datastore;

in response to determining that the data store should be optimized,optimizing the data store based on the usage information.

An eighth item according to the seventh item comprises the determiningbased at least on one or more of: frequency of use of particularmaterialized views, processing time for received requests, cost ofunoptimized read operations, frequency of data changes, and cost ofupdating materialized views.

A ninth item according to item 7 for which optimizing the data storecomprises generating one or more materialized views based on theplurality of requests received.

A tenth item according to one of the previous items, for whichtranslating the request into one or more queries comprises:

parsing the request to generate an abstract syntax tree based on therequest;

determining a structure of the request and generating a structure modelbased on the request;

generating one or more annotations correlating one or more portions ofthe request with the metadata;

generating the one or more queries based on the abstract syntax tree,the structure model, and the one or more annotations.

What is claimed is:
 1. A method comprising: generating and storingmetadata that maps a domain model to data stored in a data store,wherein the domain model describes the data and relationships betweenthe data; receiving, from a client application, a request for datastored in the data store, wherein the request is in a first querylanguage; parsing the request to generate an abstract syntax tree basedon the request; determining a structure of the request and generating astructure model based on the request; generating one or more annotationscorrelating one or more portions of the request with the metadata;generating one or more queries in a second query language based on theabstract syntax tree, the structure model, and the one or moreannotations; sending the one or more queries to the data store;receiving a first result set from the data store, based on the datastore executing the one or more queries.
 2. The method of claim 1wherein the first result set is in a first data format, the methodfurther comprising: transforming the first result set to a second dataformat; sending the first result set in the second data format to theclient application.
 3. The method of claim 2 wherein the data store isconfigured to store the data using a plurality of data formats, themethod further comprising: receiving a second result set in a third dataformat, wherein the third data format is different from the first dataformat and the second data format; transforming the second result set tothe second data format and combining the second result set with thefirst result set; sending the combined result set to the clientapplication.
 4. The method of claim 1 wherein the data store is one of aplurality of different data stores, wherein each data store of theplurality of different data stores is configured to receive requests ina particular query language, the method further comprising selecting thesecond query language based on the data store for which the request wasreceived.
 5. The method of claim 1 wherein the first query language is ageneral request language, and wherein the second query language is adata store specific query language.
 6. The method of claim 1 furthercomprising: prior to receiving a request for data, sending to the clientapplication, metadata that describes the domain model.
 7. The method ofclaim 1 further comprising: receiving a plurality of requests for data;storing usage information associated with the plurality of requests;based on the usage information, determining whether to optimize the datastore; in response to determining that the data store should beoptimized, optimizing the data store based on the usage information. 8.The method of claim 7 wherein the determining is based at least on oneor more of: frequency of use of particular materialized views,processing time for received requests, cost of unoptimized readoperations, frequency of data changes, and cost of updating materializedviews.
 9. The method of claim 7 wherein optimizing the data storecomprises generating one or more materialized views based on theplurality of requests received.
 10. The method of claim 1, each of theone or more annotations containing a query language alias generated in ascope of the request.
 11. A system comprising: one or more processors;one or more non-transitory computer-readable media storing instructionswhich, when executed by the one or more processors, cause: generatingand storing metadata that maps a domain model to data stored in a datastore, wherein the domain model describes the data and relationshipsbetween the data; receiving, from a client application, a request fordata stored in the data store, wherein the request is in a first querylanguage; parsing the request to generate an abstract syntax tree basedon the request; determining a structure of the request and generating astructure model based on the request; generating one or more annotationscorrelating one or more portions of the request with the metadata;generating one or more queries in a second query language based on theabstract syntax tree, the structure model, and the one or moreannotations; sending the one or more queries to the data store;receiving a first result set from the data store, based on the datastore executing the one or more queries.
 12. The system of claim 11wherein the first result set is in a first data format, furthercomprising instructions which, when executed using the one or moreprocessors, cause: transforming the first result set to a second dataformat; sending the first result set in the second data format to theclient application.
 13. The system of claim 12 wherein the data store isconfigured to store the data using a plurality of data formats, furthercomprising instructions which, when executed using the one or moreprocessors, cause: receiving a second result set in a third data format,wherein the third data format is different from the first data formatand the second data format; transforming the second result set to thesecond data format and combining the second result set with the firstresult set; sending the combined result set to the client application.14. The system of claim 11 wherein the data store is one of a pluralityof different data stores, wherein each data store of the plurality ofdifferent data stores is configured to receive requests in a particularquery language, further comprising instructions which, when executedusing the one or more processors, cause selecting the second querylanguage based on the data store for which the request was received. 15.The system of claim 11 wherein the first query language is a generalrequest language, and wherein the second query language is a data storespecific query language.
 16. The system of claim 11 further comprisinginstructions which, when executed using the one or more processors,cause: prior to receiving a request for data, sending to the clientapplication, metadata that describes the domain model.
 17. The system ofclaim 11 further comprising instructions which, when executed using theone or more processors, cause: receiving a plurality of requests fordata; storing usage information associated with the plurality ofrequests; based on the usage information, determining whether tooptimize the data store; in response to determining that the data storeshould be optimized, optimizing the data store based on the usageinformation.
 18. The system of claim 17 wherein the determining is basedat least on one or more of: frequency of use of particular materializedviews, processing time for received requests, cost of unoptimized readoperations, frequency of data changes, and cost of updating materializedviews.
 19. The system of claim 17 wherein optimizing the data storecomprises generating one or more materialized views based on theplurality of requests received.
 20. The system of claim 11, each of theone or more annotations containing a query language alias generated in ascope of the request.